<script setup lang="ts">
import type NotificationType from './types'
interface Props {
  notifications: NotificationType[]
}
defineProps<Props>()
</script>

<template>
  <div class="notification-container">
    <div class="vertical-line"></div>

    <div v-for="notifaction in notifications" :key="notifaction.id" class="notification-item">
      <div class="notification-circle"></div>
      <div class="time">{{ notifaction.time }}</div>
      <p>
        <span class="name">{{ notifaction.name }}</span>
        {{ notifaction.msg }}
      </p>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.notification-container {
  background-color: #fff;
  height: 100%;
  overflow: hidden;
  position: relative;
  padding: 0 10px;

  .vertical-line {
    position: absolute;
    left: 10px;
    width: 2px;
    height: 100%;
    background-color: #c1c0c0;
  }

  .notification-item {
    /* border: 1px solid black; */
    margin: 10px 10px;
    position: relative;
    padding: 10px 0px 0px 0px;
    color: rgb(28, 27, 27);
    animation: movein 1s ease both;

    @keyframes movein {
      from {
        transform: translateY(50px);
        opacity: 0;
      }

      to {
        transform: translateY(0px);
        opacity: 1;
      }
    }

    .notification-circle {
      position: absolute;
      top: 9.5px;
      left: -12.5px;
      width: 8px;
      height: 8px;
      border-radius: 100%;
      background-color: #fff;
      border: 2px solid #5f98cd;
    }

    .time {
      /* background-color: #43627d; */
      font-size: 11px;
      line-height: 11px;
    }

    p {
      font-size: 15px;
      line-height: 20px;
      margin: 0;
      padding: 10px;
      .name {
        font-weight: bold;
      }
    }
  }
}
</style>
